<?php

include dirname(dirname(__FILE__)).'/dao/impl/MySQLDaoImpl.php';
//phpinfo();
testQueryAll();
function testOpenConn(){
	$mysql=new MySQLDaoImpl(dirname(dirname(__FILE__)).'/config/config2.php');
	$conn=$mysql->openConn();
	print_r($conn);
}

function testQueryAll(){
	$mysql=new MySQLDaoImpl(dirname(dirname(__FILE__)).'/config/config2.php');
	$query="select * from t_eteksac_access_session";
	$array=$mysql->queryAll($query);
	print_r($array);
}

function testQueryAll2(){
	$mysql=new MySQLDaoImpl(dirname(dirname(__FILE__)).'/config/config2.php');
	$query="select count(*) from t_eteksac_access_session";
	$array=$mysql->queryAll($query);
	print_r($array);
}

function testCount(){
	$mysql=new MySQLDaoImpl(dirname(dirname(__FILE__)).'/config/config2.php');
	$query="select count(*) from t_eteksac_access_session";
	$count=$mysql->count($query);
	print_r($count);
}

function testSave(){
	$mysql=new MySQLDaoImpl(dirname(dirname(__FILE__)).'/config/config2.php');
	$query="insert into user(username,truename,password,sex,age,des,birth) values('php','php数据库操作','123456','男',25,'','2014-07-23')";
	$count=$mysql->save($query);
	print_r($count);
}

function testDelete(){
	$mysql=new MySQLDaoImpl(dirname(dirname(__FILE__)).'/config/config2.php');
	$query="delete from user where user_id=2";
	$count=$mysql->execute($query);
	print_r($count);
}





?>